package bestTeam.WalkieDoggie.client;

import java.util.Comparator;
import java.util.Date;

import bestTeam.WalkieDoggie.client.Serializables.UserRequest;

public class timeFrameComperator implements Comparator<UserRequest>{

	private int order=1;
	
	public timeFrameComperator(int ord){
		order=ord;
	}
	
	@Override
	public int compare(UserRequest o1, UserRequest o2) {

		String t1=o1.getTimeFrame();
		String t2=o2.getTimeFrame();
		int res=0;
		int i1=0,i2=0;
		
		if(t1.equals(partOfTheDay.Morning.toString()))
			i1=1;
		if(t1.equals(partOfTheDay.Noon.toString()))
			i1=2;
		if(t1.equals(partOfTheDay.Evening.toString()))
			i1=3;
		if(t1.equals(partOfTheDay.Night.toString()))
			i1=4;
		if(t2.equals(partOfTheDay.Morning.toString()))
			i2=1;
		if(t2.equals(partOfTheDay.Noon.toString()))
			i2=2;
		if(t2.equals(partOfTheDay.Evening.toString()))
			i2=3;
		if(t2.equals(partOfTheDay.Night.toString()))
			i2=4;
		
		return (i1-i2) * order;
	}

}
